﻿using System.Text;
using Topshelf;

namespace TipokHostManager
{
    class Program
    {
        private static StringBuilder err = new StringBuilder();
        static void Main(string[] args)
        {
            var host = HostFactory.New(x =>
            {
                x.Service<HostServices>(s =>
                {
                    s.SetServiceName("TipokHostManager");
                    s.ConstructUsing(name => new HostServices());
                    s.WhenStarted(tc =>
                    {
                        tc.Start();
                    });
                    s.WhenStopped(tc => tc.Stop());
                });
                x.RunAsLocalSystem();
                x.SetDescription("负责计算机应用或服务监控及远程管理的服务");
                x.SetDisplayName("TipokHostManager监控管理服务");
                x.SetServiceName("TipokHostManager");
            });
            host.Run();
        } 
    }
}
